package com.yidu.drug.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.yidu.drug.model.WholesaleDetailModel;

public interface WholesaleDetailModelMapper {
	int deleteByPrimaryKey(String pfxqlId);

	int insert(WholesaleDetailModel record);

	int insertSelective(WholesaleDetailModel record);

	WholesaleDetailModel selectByPrimaryKey(String pfxqlId);

	int updateByPrimaryKeySelective(WholesaleDetailModel record);

	int updateByPrimaryKey(WholesaleDetailModel record);
	/**
	 * 点击退货出现退货单(批发分页)
	 * @param record
	 * @return
	 */
	int findTotalRows(WholesaleDetailModel record);

	List<WholesaleDetailModel> findAllPage(Map<String,String> paramMap);

	List<WholesaleDetailModel> findLoginRows(WholesaleDetailModel t);
	/**
	 * 根据药品Id查询数据得到相对应的批发订单详情
	 * @param drugId 药品Id
	 * @return 批发详情对象
	 */
	WholesaleDetailModel findDrugId(@Param("id")String drugId,@Param("numbers")String numbers);
	/**
	 * 根据药品名称查询药品ID
	 * @param drugName 药品名称
	 * @return 药品ID
	 */
	String findDrug(String drugName);
	/**
	 * 根据批发id删除
	 * @param pfId 批发Id
	 * @return 影响行数
	 */
	Integer deleteByPfId(String pfId);
	/**
	 * 根据批发id查询批发详情信息
	 * @param pfId 批发Id
	 * @return 批发详情集合
	 */
	List<WholesaleDetailModel> findPfId(String pfId);
	/**
	 * 根据业务Id和批次号查询库存明细中的数量
	 * @param pwId 业务Id
	 * @param numbers 批次号
	 * @return 库存明细中的数量
	 */
	Integer findPwIdNumbers(@Param("pwId")String pwId, @Param("numbers")String numbers);

	WholesaleDetailModel findByPfxqlId(String pfxqlId);
	/**
	 * 批发的查看详情
	 */
	 List<WholesaleDetailModel> findByPfIds(@Param("wholesaleDetailModel")WholesaleDetailModel wholesaleDetailModel,@Param("page")int page,@Param("limit")int limit);
	/**
	 * 批发的查看详情
	 */
	 public Integer findRows(String pfId);

	List<WholesaleDetailModel> findByPfId(String pfId);
	/**
	 * 批发财务审核的查看详情
	 * @param fdPoBreakdownModel
	 * @param page
	 * @param limit
	 * @return
	 */
	List<WholesaleDetailModel> findByPfIdSh(@Param("wholesaleDetailModel")WholesaleDetailModel wholesaleDetailModel,@Param("page")int page,@Param("limit")int limit);
	/**
	 * 批发财务审核的查看详情(分页)
	 * @param fdPoBreakdownModel
	 * @param page
	 * @param limit
	 * @return
	 */
	int findRowsSh(WholesaleDetailModel wholesaleDetailModel);
	
}